package com.hanthink.system.service.impl;

import java.util.List;
import com.hanthink.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hanthink.system.mapper.EmQualityWeighingMapper;
import com.hanthink.system.domain.EmQualityWeighing;
import com.hanthink.system.service.IEmQualityWeighingService;

/**
 * 质量称重Service业务层处理
 * 
 * @author tzy
 * @date 2023-09-04
 */
@Service
public class EmQualityWeighingServiceImpl implements IEmQualityWeighingService 
{
    @Autowired
    private EmQualityWeighingMapper emQualityWeighingMapper;

    /**
     * 查询质量称重
     * 
     * @param id 质量称重ID
     * @return 质量称重
     */
    @Override
    public EmQualityWeighing selectEmQualityWeighingById(Long id)
    {
        return emQualityWeighingMapper.selectEmQualityWeighingById(id);
    }

    /**
     * 查询质量称重列表
     * 
     * @param emQualityWeighing 质量称重
     * @return 质量称重
     */
    @Override
    public List<EmQualityWeighing> selectEmQualityWeighingList(EmQualityWeighing emQualityWeighing)
    {
        return emQualityWeighingMapper.selectEmQualityWeighingList(emQualityWeighing);
    }

    /**
     * 新增质量称重
     * 
     * @param emQualityWeighing 质量称重
     * @return 结果
     */
    @Override
    public int insertEmQualityWeighing(EmQualityWeighing emQualityWeighing)
    {
        emQualityWeighing.setCreateTime(DateUtils.getNowDate());
        return emQualityWeighingMapper.insertEmQualityWeighing(emQualityWeighing);
    }

    /**
     * 修改质量称重
     * 
     * @param emQualityWeighing 质量称重
     * @return 结果
     */
    @Override
    public int updateEmQualityWeighing(EmQualityWeighing emQualityWeighing)
    {
        return emQualityWeighingMapper.updateEmQualityWeighing(emQualityWeighing);
    }

    /**
     * 批量删除质量称重
     * 
     * @param ids 需要删除的质量称重ID
     * @return 结果
     */
    @Override
    public int deleteEmQualityWeighingByIds(Long[] ids)
    {
        return emQualityWeighingMapper.deleteEmQualityWeighingByIds(ids);
    }

    /**
     * 删除质量称重信息
     * 
     * @param id 质量称重ID
     * @return 结果
     */
    @Override
    public int deleteEmQualityWeighingById(Long id)
    {
        return emQualityWeighingMapper.deleteEmQualityWeighingById(id);
    }

    @Override
    public EmQualityWeighing selectOneByEquipKey(String key) {
        return emQualityWeighingMapper.selectOneByEquipKey(key);
    }
}
